<template>
  <div class="setting">
    <template v-if="tabType == 'data'">
      <div class="card">
        <div class="title">内容设置</div>
        <div class="content">
          <el-form-item label="视频链接">
            <el-input v-model="settingData.data.videoUrl">
              <template #append>
                <span class="cursor-pointer" @click="selectVideo">选择</span>
              </template>
            </el-input>
          </el-form-item>
          <el-form-item label="视频封面">
            <div class="sa-flex">
              <sa-uploader v-model="settingData.data.src" fileType="image"></sa-uploader>
            </div>
          </el-form-item>
        </div>
      </div>
    </template>
  </div>
</template>

<script setup>
  import { useFile } from '@/sheep/components/sa-file/sa-file-modal.vue';

  const props = defineProps(['settingData', 'tabType']);

  function selectVideo() {
    useFile(
      {
        fileType: 'video',
      },
      {
        confirm: (data) => {
          props.settingData.data.videoUrl = data.url;
        },
      },
    );
  }
</script>
